
<?php

class LoginModel{
    public $mysql;
    public function __construct() {
        include DOCUMENT_ROOT."/Framework/mysql.class.php";
        $this->mysql=new mysql();
        $this->mysql->db("user");
    }

    /*
         * 登录
         * 
         */
    public function select($where){//登录判断
            $sql="select * from yonghu where $where";
            $result=$this->mysql->select($sql);
            return $result;
        }
        
        

// =============================================================================
    
        /*
         * 列表
         * 
         */
        public function changselect(){
            $sql="select * from yonghu";
            $arr= $this->mysql->select($sql);
            return $arr;
            
        }
// =============================================================================
        /*
         * 修改
         */
        public function xiugai($id){
            $sql="select * from yonghu where id=$id";
            $arr= $this->mysql->select($sql);
            return $arr;
        }
        
        public function XG($name,$pwd,$id){
        $sql="update yonghu set name= '$name',pwd = '$pwd' where id= $id";
        $arr = $this->mysql->update($sql);
        return $arr;
    }
}